package com.example.demo.mapper;

import com.example.demo.entity.ImageRecognitionHistory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper  // 添加这个注解
public interface ImageRecognitionHistoryMapper {

    @Insert("INSERT INTO image_recognition_history (file_name, recognition_result, upload_time) " +
            "VALUES (#{fileName}, #{recognitionResult}, #{uploadTime})")
    void insertHistory(ImageRecognitionHistory history);

    @Select("SELECT * FROM image_recognition_history")
    List<ImageRecognitionHistory> getAllHistory();
}
